package com.shazhu.nongjt.service.impl;

import java.util.List;
import com.shazhu.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.shazhu.nongjt.mapper.NjtPrinterSerialMapper;
import com.shazhu.nongjt.domain.NjtPrinterSerial;
import com.shazhu.nongjt.service.INjtPrinterSerialService;

/**
 * 打印机序列号库Service业务层处理
 * 
 * @author shazhu
 * @date 2025-09-29
 */
@Service
public class NjtPrinterSerialServiceImpl implements INjtPrinterSerialService 
{
    @Autowired
    private NjtPrinterSerialMapper njtPrinterSerialMapper;

    /**
     * 查询打印机序列号库
     * 
     * @param serialId 打印机序列号库主键
     * @return 打印机序列号库
     */
    @Override
    public NjtPrinterSerial selectNjtPrinterSerialBySerialId(Long serialId)
    {
        return njtPrinterSerialMapper.selectNjtPrinterSerialBySerialId(serialId);
    }

    /**
     * 查询打印机序列号库列表
     * 
     * @param njtPrinterSerial 打印机序列号库
     * @return 打印机序列号库
     */
    @Override
    public List<NjtPrinterSerial> selectNjtPrinterSerialList(NjtPrinterSerial njtPrinterSerial)
    {
        return njtPrinterSerialMapper.selectNjtPrinterSerialList(njtPrinterSerial);
    }

    /**
     * 新增打印机序列号库
     * 
     * @param njtPrinterSerial 打印机序列号库
     * @return 结果
     */
    @Override
    public int insertNjtPrinterSerial(NjtPrinterSerial njtPrinterSerial)
    {
        njtPrinterSerial.setCreateTime(DateUtils.getNowDate());
        return njtPrinterSerialMapper.insertNjtPrinterSerial(njtPrinterSerial);
    }

    /**
     * 修改打印机序列号库
     * 
     * @param njtPrinterSerial 打印机序列号库
     * @return 结果
     */
    @Override
    public int updateNjtPrinterSerial(NjtPrinterSerial njtPrinterSerial)
    {
        njtPrinterSerial.setUpdateTime(DateUtils.getNowDate());
        return njtPrinterSerialMapper.updateNjtPrinterSerial(njtPrinterSerial);
    }

    /**
     * 批量删除打印机序列号库
     * 
     * @param serialIds 需要删除的打印机序列号库主键
     * @return 结果
     */
    @Override
    public int deleteNjtPrinterSerialBySerialIds(Long[] serialIds)
    {
        return njtPrinterSerialMapper.deleteNjtPrinterSerialBySerialIds(serialIds);
    }

    /**
     * 删除打印机序列号库信息
     * 
     * @param serialId 打印机序列号库主键
     * @return 结果
     */
    @Override
    public int deleteNjtPrinterSerialBySerialId(Long serialId)
    {
        return njtPrinterSerialMapper.deleteNjtPrinterSerialBySerialId(serialId);
    }
}
